/*
 * @Author: tkp
 * @Date: 2025-01-21 14:57:45
 */
import { authSystemAdminAdd, authSystemAdminModify, authSystemAdminModifyDefaultFlag, authSystemAdminModifyEnble, authSystemAdminModifyPwd, authSystemAdminQuery, authSystemAdminDel, authorization } from '@/utils/api'
export class IndexBloc {
    queryForm = {
        adminName: '',
        sysAdminAccount: '',
        defaultFlag: '',
        enable: '',
    }
    sysTeamType = []
    pageNum = 1
    pageSize = 50
    total = 0
    addPop = false
    rowItem = ''
    editPop = false
    rolePop = false
    pwdPop = false
    defaultFlagLst = [{ label: '是', value: 1 }, { label: '否', value: 0 }]
    enableLst = [{ label: '是', value: 1 }, { label: '否', value: 0 }]
    tableOption = [
        { label: '系统管理员名称', prop: 'adminName', },
        { label: '系统管理员账号', prop: 'sysAdminAccount', },
        { label: '是否默认', prop: 'defaultFlag', slot: 'defaultFlag' },
        { label: '是否可用', prop: 'enable', slot: 'enable' },
    ]
    tableData = []
    load(data) {
        authSystemAdminQuery(data).then(res => {
            this.tableData = res.data.lst || []
            this.total = res.data.total || 0
        })
    }
    modify(data) {
        return authSystemAdminModify(data)
    }
    modifyDefaultFlag(data) {
        return authSystemAdminModifyDefaultFlag(data)
    }
    modifyEnble(data) {
        return authSystemAdminModifyEnble(data)
    }
    modifyPwd(data) {
        return authSystemAdminModifyPwd(data)
    }
    add(data) {
        return authSystemAdminAdd(data)
    }
    del(data) {
        return authSystemAdminDel(data)
    }
    changeRole(data) {
        return authorization(data)
    }
}